<#include "/common/common.ftl" encoding="UTF-8">
	<link href="${staticUrl}/css/form.css" type="text/css" rel="stylesheet" />
	<link href="${staticUrl}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
	<script src="${staticUrl}/js/validate/jquery.validate.js" type="text/javascript"></script>
	<script src="${staticUrl}/js/validate/messages_cn.js" type="text/javascript"></script>
	<#assign action="dept">
	<script>
		var treeUrl = "${request.contextPath}/security/dept!deptTree.action?id=1&exceptionId=${id?if_exists}";
		$(document).ready(function(){
			//为inputForm注册validate函数
			$("#inputForm").validate();
			$("#parentName").click(function(e){
				previewShow(e);
			});
		});
		function showDetail(id,title){
			$("#parentId").val(id);
			$("#parentName").val(title);
			$("#preview").hide();
		}
	</script>
</head>
<body>
<#include "/common/tree_div.ftl" encoding="UTF-8">
<div class='title'><#if id?exists>修改<#else>创建</#if>部门</div>
<div id="inputContent">
<form id="inputForm" action="${action}!save.action" method="post">
<input type="hidden" name="id" value="${(id)?if_exists}" />
<table>
	<tr>
		<@ftlMacro.inputText name="code" descript="部门代码" textShow="${code?if_exists}" cssStyle="required"/>
	</tr>
	<tr>
		<@ftlMacro.inputText name="name" descript="部门名称" textShow="${name?if_exists}" cssStyle="required"/>
	</tr>
	<tr>
		<td>上级部门</td>
		<td>
			<input type="hidden" name='parent.id' id="parentId" value="${(parent.id)?if_exists}"/>
			<input type="text" name="parent.name" id="parentName" size="40" value="${(parent.name)?if_exists}" class="required"/>		
		</td>
	</tr>
	<tr>
		<@ftlMacro.detailText descript="创建时间" textShow="${createTime?if_exists}"/>
	</tr>
	<tr>
		<td colspan="2">
			<input type="submit" value="提交" />&nbsp; 
			<input type="button" value="取消" onclick="history.back()"/>
		</td>
	</tr>
</table>
</form>
</div>
</body>
</html>